<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.global.js"></script>
</head>
<style>
    ul{
        list-style: none;
        display: flex;
    }
    li{
        padding: 20px;
        background-color: antiquewhite;
        margin-left: 10px;
    }
    .red{
        background-color: red;
        color: aliceblue;
    }
</style>
<body>
    <div class="app">
        <ul>
            <li 
            v-for="(v,i) in movies" 
            :key="i" 
            :class="{red:index==i}"
            @click="index=i">{{v}}</li>
        </ul>
    </div>
    <script>
        const { createApp } = Vue
        createApp({
          data(){
            return{
                movies:["《新蝙蝠侠》","《楚门的世界》","《你好！李银河》"],
                index:0
            }
          },
          methods:{

          }
        }).mount('.app')
    </script>
</body>
</html>